/**
 * 全局配置不可取 会导致全局分页失效 total也是Long型
 */
//package com.ningxun.pagent.common.config.serializer;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.fasterxml.jackson.databind.module.SimpleModule;
//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
//
//import java.math.BigInteger;
//
//@Configuration
//public class ApiMvcConfiguration {
//
//    @Bean
//    @Primary
//    @ConditionalOnMissingBean(ObjectMapper.class)
//    public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder)
//    {
//        ObjectMapper objectMapper = builder.createXmlMapper(false).build();
//        // 全局配置序列化返回 JSON 处理
//        SimpleModule simpleModule = new SimpleModule();
//        //JSON Long ==> String
//        //超长整
//        simpleModule.addSerializer(BigInteger.class, ToStringSerializer.instance);
//        //长整
//        simpleModule.addSerializer(Long.class,ToStringSerializer.instance);
//        //长整
//        simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
//        objectMapper.registerModule(simpleModule);
//        return objectMapper;
//    }
//}
